﻿using Little.Soldier.SWIFT;
using Little.Soldier.SWIFT.Definition;
using System;

namespace Little.Soldier.SWIFT.Messages.Category2
{
  public class Tag32J : SwiftTagWrapper
  {
    public string Value
    {
      get
      {
        return this.GetValue();
      }
      set
      {
        this.SetValue("32J", value);
      }
    }

    public Decimal Amount
    {
      get
      {
        Decimal result = new Decimal(0);
        Decimal.TryParse(this.Value, out result);
        return result;
      }
      set
      {
        this.Value = value.ToString();
      }
    }

    internal Tag32J(SwiftElement parent, int index, SwiftDefinitionElement definition)
      : base(parent, index, definition)
    {
    }
  }
}
